<!--
 * @Author: EuniceShaw
 * @Date: 2022-04-10 11:01:17
 * @LastEditors: EuniceShaw
 * @LastEditTime: 2022-04-10 18:55:25
 * @Description: redirect
-->
<script lang="ts">
import { h } from 'vue'
import { useRoute, useRouter } from 'vue-router'

export default {
  name: 'Redirect',
  setup() {
    const route = useRoute()
    const router = useRouter()
    const { query, params } = route

    router.replace({
      path: '/' + params.path,
      query
    })
    return () => {
      return h('template')
    }
  }
}
</script>
